<script setup>
// 1. 引入 reactie
import { reactive } from 'vue'

// 2. 用reactive包裹数组或者对象
const student = reactive({
    name: 'tom',
    age: 13
})

const birthday = () => {
    student.age++
}
</script>

<template>
    <div>
        学生姓名: {{ student.name }} 已经 {{ student.age }} 岁了
    </div>
    <button @click="birthday">过生日</button>
</template>
  
<style lang="less"></style>
  